package com.hyd.mall.tiny.nosql.elasticsearch.document;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 搜索中的商品信息
 * @author ayiyaha
 */
@Document(indexName = "pms",type = "product",shards = 1,replicas = 0)
public class EsProduct implements Serializable {
	private static final long serialVersionUID = -1L;
	@Id
	private Long id;
	@Field(type = FieldType.Keyword)
	private String productSn;
	private Long brandId;
	@Field(type = FieldType.Keyword)
	private String brandName;
	private Long productCategoryId;
	@Field(type = FieldType.Keyword)
	private String productCategoryName;
	private String pic;
	@Field(analyzer = "ik_max_word",type = FieldType.Text)
	private String name;
	@Field(analyzer = "ik_max_word",type = FieldType.Text)
	private String subTitle;
	@Field(analyzer = "ik_max_word",type = FieldType.Text)
	private String keywords;
	private BigDecimal price;
	private Integer sale;
	private Integer newStatus;
	private Integer recommandStatus;
	private Integer stock;
	private Integer promotionType;
	private Integer sort;
	@Field(type = FieldType.Nested)
	private List<EsProductAttributeValue> attrValueList;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getProductSn() {
		return productSn;
	}

	public void setProductSn(String productSn) {
		this.productSn = productSn;
	}

	public Long getBrandId() {
		return brandId;
	}

	public void setBrandId(Long brandId) {
		this.brandId = brandId;
	}

	public String getBrandName() {
		return brandName;
	}

	public void setBrandName(String brandName) {
		this.brandName = brandName;
	}

	public Long getProductCategoryId() {
		return productCategoryId;
	}

	public void setProductCategoryId(Long productCategoryId) {
		this.productCategoryId = productCategoryId;
	}

	public String getProductCategoryName() {
		return productCategoryName;
	}

	public void setProductCategoryName(String productCategoryName) {
		this.productCategoryName = productCategoryName;
	}

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSubTitle() {
		return subTitle;
	}

	public void setSubTitle(String subTitle) {
		this.subTitle = subTitle;
	}

	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public Integer getSale() {
		return sale;
	}

	public void setSale(Integer sale) {
		this.sale = sale;
	}

	public Integer getNewStatus() {
		return newStatus;
	}

	public void setNewStatus(Integer newStatus) {
		this.newStatus = newStatus;
	}

	public Integer getRecommandStatus() {
		return recommandStatus;
	}

	public void setRecommandStatus(Integer recommandStatus) {
		this.recommandStatus = recommandStatus;
	}

	public Integer getStock() {
		return stock;
	}

	public void setStock(Integer stock) {
		this.stock = stock;
	}

	public Integer getPromotionType() {
		return promotionType;
	}

	public void setPromotionType(Integer promotionType) {
		this.promotionType = promotionType;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public List<EsProductAttributeValue> getAttrValueList() {
		return attrValueList;
	}

	public void setAttrValueList(List<EsProductAttributeValue> attrValueList) {
		this.attrValueList = attrValueList;
	}
}
